<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
	</body>
	<script type="text/javascript">
		//1
//		function join() {
//			var arr = ['a','b','c','d','e']
//			document.writeln(arr.join('/'))
//		}
//		join()
		
		//2
			function join(arr,splitStr) {
				var myStr=""
				for (var i = 0;i < arr1.length;i++) {
					myStr+=arr[i]
					if(i != arr1.length - 1) {
						myStr += splitStr
					} 
				}
				return myStr
			}
			var arr1 = ['a','b','c','d','e']
			splitStr='/'
			document.writeln(join(arr1,splitStr))
	</script>
</html>
